import request from '@/utils/request'


/**
 * 发布资源库
 * @param id 资源库ids
 */
export function releaseClasses(data) {
  return request({
    url: '/system/dynamic/releaseClasses',
    method: 'post',
    timeout: 1000 * 60 * 60,
    data: data
  })
}

/**
 * 发布资源
 * @param classedId 资源库id
 * @param id 资源ids
 */
export function releaseResource(data) {
  return request({
    url: '/system/dynamic/releaseResource',
    method: 'post',
    data: data
  })
}


/**
 * 下撤资源
 * @param classedId 资源库id
 * @param id 资源ids
 */
export function withdrawResource(data) {
  return request({
    url: '/system/dynamic/withdrawResource',
    method: 'post',
    data: data
  })
}

// 获取列表
export function listDynamic(query) {
  return request({
    url: '/system/dynamic/list',
    method: 'get',
    params: query
  })
}

// 获取查询字段
export function selectField(classesId) {
  return request({
    url: '/system/dynamic/selectField/'+classesId,
    method: 'get'
  })
}

// 获取详情字段
export function detailsField(classesId) {
  return request({
    url: '/system/dynamic/detailsField/'+classesId,
    method: 'get'
  })
}

// 审核资源
export function auditDynamic(data) {
  return request({
    url: '/system/dynamic/audit',
    method: 'post',
    data: data
  })
}

// 新增资源
export function addDynamic(data) {
  return request({
    url: '/system/dynamic/add',
    method: 'post',
    data: data
  })
}

// 修改资源
export function editDynamic(data) {
  return request({
    url: '/system/dynamic/edit',
    method: 'post',
    data: data
  })
}

// 修改资源
export function delDynamic(data) {
  return request({
    url: '/system/dynamic/del',
    method: 'post',
    data: data
  })
}


/**
 * 查询资源
 * @param classedId 资源库id
 * @param id 资源id
 */
export function findDynamic(classedId, id) {
  return request({
    url: '/system/dynamic/find/'+classedId+'/' + id,
    method: 'get'
  })
}

  /**
   * 用户部门查询下拉接口
   * @param classedId 资源库id
   * @param id 资源ids
   */
export function dynamicDataUserDepartmentQueryConditions(data) {
    return request({
      url: '/system/dynamic/dynamicDataUserDepartmentQueryConditions',
      method: 'post',
      data: data
    })
  }



